package com.thingsgrid.basicInterface.wrapper;

import com.thingsgrid.basicInterface.myenum.TypeEnum;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import com.thingsgrid.basicInterface.entity.BasicInterfaceType;
import com.thingsgrid.basicInterface.vo.BasicInterfaceTypeVO;

/**
 * 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2019-08-10
 */
public class BasicInterfaceTypeWrapper extends BaseEntityWrapper<BasicInterfaceType, BasicInterfaceTypeVO>  {

	public static BasicInterfaceTypeWrapper build() {
		return new BasicInterfaceTypeWrapper();
 	}

	@Override
	public BasicInterfaceTypeVO entityVO(BasicInterfaceType basicInterfaceType) {
		BasicInterfaceTypeVO basicInterfaceTypeVO = BeanUtil.copy(basicInterfaceType, BasicInterfaceTypeVO.class);
		basicInterfaceTypeVO.setCategory(TypeEnum.getName(basicInterfaceType.getCategory()));
		return basicInterfaceTypeVO;
	}

}
